package io.renren.modules.knowledge.respository;

import io.renren.modules.knowledge.entity.node.course;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CourseRespository extends Neo4jRepository<course,Long> {


    course getCourseByName(String name);

    boolean deleteCourseById(Long id);

    @Query("match (c:course) where id(c) = {id} with c  match (c)-[:contain]->(mm) return mm")
    List getKnowledgeByCourseId(@Param("id") Long id);
}
